# 猜数字游戏
# 实现猜数字游戏

# 判断 二分查找

import random

start = 1
end = 100
system = random.randint(start, end)

while True:
    user = int(input(f'请输入你猜测的数字（它可能在{start}到{end}之间)：'))
    if user == system:
        print('恭喜你，猜对了')
        break
    if user > system:
        print('恭喜你，猜测大了')
        end = user
        continue
    if user < system:
        print('恭喜你，猜小了')
        start = user
        continue

print('游戏结束，感谢游玩')
